#include "mainwindow.h"
#include <KLocalizedString>
#include <QDebug>
#include <QPushButton>
#include <QTimer>

class ChildWidget : public QWidget
{
    Q_OBJECT
    Q_CLASSINFO("D-Bus Interface", "org.ukui.kwin.Screenshot")

public:
    ChildWidget(QWidget *parent);
    ~ChildWidget();
};

ChildWidget::ChildWidget(QWidget *parent)
    : QWidget(parent)
{
}

ChildWidget::~ChildWidget()
{
}

MainWindow::MainWindow(QWidget *parent)
    : QMainWindow(parent)
{
}

MainWindow::~MainWindow()
{
}

void MainWindow::init()
{
    setMinimumWidth(240);
    {
        ChildWidget *p = new ChildWidget(this);
        QPushButton *hasKeyStateLabel = new QPushButton(this);
        QString dd = i18n("Maximize");
        hasKeyStateLabel->setText(i18n("Maximize"));
        QObject::connect(hasKeyStateLabel, &QPushButton::clicked, this, &MainWindow::slotButton);
    }
}

void MainWindow::slotButton()
{
    hide();
    QTimer::singleShot(1000, this, [this]() {
        qWarning() << "[=== checkmode ===]"
                   << "show";
        show();
    });
}

#include "mainwindow.moc"